<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(name, age) {
            this.name = name;
            this.age = age;
        }

        Person.prototype.out = function() {
            console.log(`我叫: ${this.name}`);
        }

        const p = new Person('刘军', 18);

        class Personc {
            constructor(name, age) {
                this.name = name;
                this.age = age;
            }

            out() {
                console.log(`我叫: ${this.name}`);
            }
        }

        const pc = new Personc('陈赫', 36);
    </script>
</body>
</html>